Chris Pollett >Old Classes >
CS151

( Print View )

Student Corner:
  [Grades Sec5]

  [Submit Sec5]

  [Email List Sec5]

  [
Lecture Notes]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












HW#4 --- last modified March 02 2019 21:22:45..

Solution set.

Due date: Nov 21

Files to be submitted:
  JetDesigner.zip

Purpose: To gain experiences with the container, GUI, and input/output frameworks described in class. To create an application using an iterative design process.

Specification:

A recent trend among the super-rich is buy commercial jets and to outfit them as private jets. For this homework, you will create a Java application which will allow such a person to design the interior layout of a jet. Your project should be created in three iterations. The main class of iteration 1 should be called JetDesigner1.java, the main class of iteration 2 should be called JetDesigner2.java, and finally the main class of iteration 3 whould be called JetDesigner3.java. JetDesigner3 should extend JetDesigner2 should extend JetDesigner1. You will submit your completed project in the file JetDesigner.zip. The grader will unzip this file and switch into its directory. He will then type the commands:

ant JetDesigner1

ant JetDesigner2

ant JetDesigner3

To test each of your iterations.

Here is a brief description of what each iteration of your program should support.

Iteration 1: Your application should create a JFrame with title JetDesigner! Initially, the content of the frame is a large JLabel with JetDesigner! on it, and underneath this there is a JComboBox which allows the user to select from at least four different airplane fuselages: 747, 777, A340, A380. Selecting a a fuselage completely changes the display on the frame. It should now have on it a JPanel on which an airplane fuselage is drawn. On the right hand side of the frame there should be at least three JButton's, each with a different item an airplane interior designer might want to put in an airplane. For example, you could have a button with a bed, a button with a bar on it, a button for seats, a button for sofas, a button for TV sets, etc. After clicking a button, the cursor should be the image that was on the button. One can then move over to the airplane fuselage and click at a point within it to place the selected item in the airplane. This should result in the cursor switching back to the default arrow cursor. The rules for placing an item should be that an item can only be placed entirely within the airplane and an item is not allowed to be placed so that it overlaps a previously placed item.

Iteration 2: In this iteration you should add a menu bar to your application with a menu that allows the user to save and load airplanes. It should also have an undo, redo, and exit feature. You might want to consider using a JChooserPane for this. The classes which need to be serialized (make sure you have at least one) for saving your program should be written so that they are all in what the book calls canonical form.

Iteration 3: In this iteration you should support resizing of the items you can place within the airplane. In addition, once an item is placed a dialog should open in which a comment about that item can be typed. After this comment should appear as a tool tip if one hovers over that part of the airplane in the future.

Point Breakdown

Departmental coding guidelines for Java followed 1pt
build.xml file works as described 1pt
JetDesigner1, JetDesigner2, JetDesigner3 extend each other as described 1pt
Initial launch is as described allowing a fuselage to be selected 1pt
Iteration 1 buttons and panels as described 1pt
Placement of items works as described 1pt
Iteration2 menus and JChoosePane work as described 1pt
Serializable classes in canonical form 1pt
Iteration3: Resizing of items is possible 1pt
Iteration3: Dialog and tooltip as described 1pt
Total10pts